from django.core.management.base import BaseCommand
from apps.absent.models import AbsentType

# 运行：python manage.py initabsenttype

class Command(BaseCommand):

    def handle(self, *args, **options):
        absent_types = ['事假','病假','调休','婚假','产假','陪产假','丧假','年假','其他']
        for absent_type in absent_types:
            AbsentType.objects.create(name=absent_type)
        self.stdout.write(self.style.SUCCESS('考勤类型数据初始化成功'))